package com.ruoyi.audit.controller;

import com.ruoyi.audit.entity.po.Order;
import com.ruoyi.audit.service.OrderService;
import com.ruoyi.audit.utils.Result;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    OrderService orderService;

    /**
     * 查询待审核的订单
     * @return
     */
    @RequestMapping("/findByOrderStatus")
    public Result findByOrderStatus(){
        return orderService.findByOrderStatus();
    }

    /**
     * 财务人员对订单进行审核
     * @param order
     * @return
     */
    @RequestMapping("/checkByOrderId")
    public Result checkByOrderId(@RequestBody Order order) {
        return orderService.checkByOrderId(order);
    }
}
